import 'dart:core';

import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_study/config/RouteConfig.dart';
import 'package:getx_study/mode/MovieItem.dart';

import 'logic.dart';



class VideoListPage extends StatelessWidget {

  final VideoListLogic logic = Get.put(VideoListLogic());

  @override
  Widget build(BuildContext context) {

    logic.loadData();

    return Scaffold(
      appBar: AppBar(title: Text("video列表")),
      floatingActionButton: FloatingActionButton(
        onPressed: () {

        },
      ),
      body: Container(
        child: Center(
          child: ListView.builder(
            itemBuilder: (ctx, index) {
              return GestureDetector(
                onTap: () {
                  Get.toNamed(RouteConfig.getBetterPlayer, arguments: logic.movies[index]);
                },
                child: ListTile(title: Text(logic.movies[index].title))
              );
            },
            itemCount: 3,
          ),
        ),
      ),
    );
  }
}
